package com.situ.Servlet.CokieSevlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class CookieSevlet_1 extends HttpServlet {
	/**
	 * 带有用户特有的标识servletContext ,加入到浏览器缓存，cookie中
	 */
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		Cookie cookie = new Cookie("goods", "MIX2S");
		Cookie cookie2 = new Cookie("goodss", "MAX2S");
		Cookie cookie3 = new Cookie("goodsss", "IphoneX");
		resp.addCookie(cookie);//加入至浏览器缓存Cookis中,只是加到Cookie中
		resp.addCookie(cookie2);
		resp.addCookie(cookie3);
	}
	
	
	
}
